package com.weijin.bookborrowmanagesystem.controller;

import com.weijin.bookborrowmanagesystem.common.Result;
import com.weijin.bookborrowmanagesystem.pojo.User;
import com.weijin.bookborrowmanagesystem.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import jdk.nashorn.internal.ir.annotations.Ignore;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author WeiJin
 * @Version 1.0
 * @Date 2025/3/13 10:06
 */
@RestController
@RequestMapping("/users")
@Api(tags = "用户控制层类")
public class UserController {

    @Resource
    private UserService userService;

    @PostMapping("/add")
    @ApiOperation("添加一个用户")
    public Result<String> addUser( @RequestBody User user){
        return userService.addUser(user);
    }
}
